<extend name="./Application/Admin/View/Layout/application.html"/>
<block name="css">
    <style>
        .daterangepicker {
            display: none;
        }
    </style>
    <link rel="stylesheet" href="__PUBLIC__/vendor/daterangepicker/daterangepicker.css">

</block>

<block name="content">


    <!-- content start -->
    <div class="admin-content">
        <div class="admin-content-body">
            <div class="am-cf am-padding am-padding-bottom-0">
                <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">订单列表</strong> /
                    <small>Order List</small>
                </div>
            </div>

            <hr>


            <div class="am-g">

                <form class="am-form-inline" role="form" method="get">

                    <div class="am-form-group">
                        <input style="width: 130px;height: 32px;margin: 2px 2px" type="text" class="am-form-field"
                               name="order_no"
                               placeholder="按订单号" value="{{$_GET['order_no']}}">

                    </div>

                    <div class="am-form-group">
                        <input style="width: 130px;height: 32px;margin: 2px 2px" type="text" class="am-form-field"
                               name="name"
                               placeholder="按收货人" value="">

                    </div>

                    <div class="am-form-group">
                        <select name="status">
                            <option value="0">订单状态</option>

                            <volist name="orderStatus" id="vo">
                                <option value="{{$i}}">
                                <!--<if condition="($i-1) eq $_GET['status']">selected</if>-->
                                {{$vo}}
                                </option>
                            </volist>

                        </select>
                    </div>


                    <div class="am-form-group">
                        <div class="am-input-group am-input-group-sm">
                            <input type="text" id="created_at" name="created_at" class="am-form-field"
                                   style="width: 180px">
                            <span class="am-input-group-btn">
                            <button class="am-btn am-btn-default" type="submit">搜索</button>
                            </span>
                            <span class="am-input-group-btn">
                            <a href="{{:U('Order/index')}}" class="am-btn am-btn-default" type="button">重置</a>
                            </span>
                        </div>
                    </div>
                </form>
            </div>

            <div class="am-g">
                <div class="am-u-sm-12">
                    <form class="am-form">
                        <table class="am-table am-table-striped am-table-hover table-main">
                            <thead>
                            <tr>
                                <th class="table-id">订单号</th>
                                <th class="table-title">收货人</th>
                                <th class="table-title">手机号</th>
                                <th class="table-type">总金额</th>
                                <th class="table-type">订单状态</th>
                                <th class="table-date am-hide-sm-only">付款时间</th>
                                <th class="table-set">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <volist name="orders" id="order">
                                <tr>
                                    <td>{{$order.order_no}}</td>
                                    <td class="am-hide-sm-only">{{$order.name}}</td>
                                    <td class="am-hide-sm-only">{{$order.tel}}</td>
                                    <td class="am-hide-sm-only">{{$order.total_price}}元</td>
                                    <td class="am-hide-sm-only">
                                        <php>if($order['status'] == 1){</php>
                                        <a class="am-btn am-btn-warning am-round am-btn-xs am-text-danger"
                                           href="">待付款</a>
                                        <php>}elseif($order['status'] == 2){</php>
                                        <a class="am-btn am-btn-danger am-round am-btn-xs am-text-danger"
                                           href="">待发货</a>
                                        <php>}elseif($order['status'] == 3){</php>
                                        <a class="am-btn am-btn-primary am-round am-btn-xs am-text-danger"
                                           href="">已发货</a>
                                        <php>}else{</php>
                                        <a class="am-btn am-btn-success am-round am-btn-xs am-text-danger"
                                           href="">已完成</a>
                                        <php>}</php>
                                    </td>
                                    <td class="am-hide-sm-only">{{$order.created_at|date="Y-m-d",###}}</td>

                                    <td>
                                        <div class="am-btn-toolbar">
                                            <div class="am-btn-group am-btn-group-xs">
                                                <a href="{{:U('show', ['id'=>$order[id]])}}"
                                                   class="am-btn am-btn-secondary am-btn-xs"><span
                                                        class="am-icon-eye"></span> 查看订单
                                                </a>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </volist>
                            </tbody>
                        </table>
                        <div class="am-cf">
                            共 {{$count}} 条记录
                            <div class="am-fr">
                                <ul class="am-pagination">
                                    {{$pages}}
                                </ul>
                            </div>
                        </div>
                        <hr/>
                        <p>注：.....</p>
                    </form>
                </div>

            </div>
        </div>

        <footer class="admin-content-footer">
            <hr>
            <p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
        </footer>

    </div>
    <!-- content end -->
</block>
<block name="js">
    <script src="__PUBLIC__/vendor/daterangepicker/moment.js"></script>
    <script src="__PUBLIC__/vendor/moment/locale/zh-cn.js"></script>
    <script src="__PUBLIC__/vendor/daterangepicker/daterangepicker.js"></script>
    <script src="__PUBLIC__/assets/admin/js/daterange_config.js"></script>

</block>
